//
//  ViewController.m
//  MovePicture
//
//  Created by Justsoso on 16/2/29.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
{
    int x,y;
}
@property (weak, nonatomic) IBOutlet UIImageView *imageView;


@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
}

- (IBAction)upLeft:(id)sender
{
    if (self.imageView.frame.origin.x > -1280 && self.imageView.frame.origin.y > -432)
    {
        self.imageView.frame = CGRectMake(x--, y--, 1600, 1000);
    }
}
- (IBAction)up:(id)sender
{
    if (self.imageView.frame.origin.y > -432)
    {
        self.imageView.frame = CGRectMake(x, y--, 1600, 1000);
    }
}
- (IBAction)upRight:(id)sender
{
    if (self.imageView.frame.origin.x < 0 && self.imageView.frame.origin.y > -432)
    {
        self.imageView.frame = CGRectMake(x++, y--, 1600, 1000);
    }
}
- (IBAction)right:(id)sender
{
    if (self.imageView.frame.origin.x < 0)
    {
        self.imageView.frame = CGRectMake(x++, y, 1600, 1000);
    }
}
- (IBAction)downRight:(id)sender
{
    if (self.imageView.frame.origin.x < 0 && self.imageView.frame.origin.y < 0)
    {
        self.imageView.frame = CGRectMake(x++, y++, 1600, 1000);
    }
}
- (IBAction)down:(id)sender
{
    if (self.imageView.frame.origin.y < 0)
    {
        self.imageView.frame = CGRectMake(x, y++, 1600, 1000);
    }
}
- (IBAction)downLeft:(id)sender
{
    if (self.imageView.frame.origin.x > -1280 && self.imageView.frame.origin.y < 0)
    {
        self.imageView.frame = CGRectMake(x--, y++, 1600, 1000);
    }
}
- (IBAction)left:(id)sender
{
    if (self.imageView.frame.origin.x > -1280)
    {
        self.imageView.frame = CGRectMake(x--, y, 1600, 1000);
    }
}

@end
